package net.dfrz.oa.dao.repository;

import net.dfrz.oa.dao.repository.support.BaseRepository;
import net.dfrz.oa.pojo.Office;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

public interface OfficeRepository extends BaseRepository<Office>{
	
	//@Modifying通知springdata这是一个update或者delete操作
	@Modifying
	@Query("UPDATE Office o SET o.name=:name,o.count=:count,o.unit=:unit WHERE o.id=:id")
	void updateOffice(@Param("id")Integer id, @Param("name")String name, @Param("count")Integer count, @Param("unit")String unit);

}
